//
//  CoreDataStore.m
//  ViperDemo
//
//  Created by Leeesven on 17/5/20.
//  Copyright © 2017年 Leeesven. All rights reserved.
//

#import "CoreDataStore.h"
#import "ManagedTodoItem.h"

@implementation CoreDataStore

- (void)fetchEntriesWithPredicate:(NSPredicate *)predicate
                  sortDescriptors:(NSArray *)sortDescriptors
                  completionBlock:(DataStoreFetchCompletionBlock)completionBlock
{
    if (completionBlock)
    {
        ManagedTodoItem *item = [ManagedTodoItem new];
        item.date = [NSDate date];
        item.name = @"item1";
        ManagedTodoItem *item2 = [ManagedTodoItem new];
        item2.date = [NSDate dateWithTimeIntervalSinceNow:24*3600];
        item2.name = @"item2";
        completionBlock(@[item, item2]);
    }
}


@end
